/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task07.task0711;

import java.util.ArrayList;
import java.util.Scanner;

/* 
删除和插入
*/

public class Solution {
    public static void main(String[] args) throws Exception {
        //在此编写你的代码
        ArrayList<String> strings = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 5; i++) {
            strings.add(scanner.next());
        }
        for (int i = 0; i < 13; i++) {
            strings.add(0, strings.remove(strings.size() - 1));
        }
        for (String string : strings) {
            System.out.println(string);
        }
    }
}
